﻿using System;
using LF.Shared.Dtos.Input;
using LF.Shared.Dtos.Out;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace LF.Application.Services
{
	public interface IWeixinService: IApplicationService
	{
        /// <summary>
        /// 上传文件
        /// 暂不实现分片
        /// </summary>
        /// <returns>md5</returns>
        Task<Result> FileUploadAsync();
        /// <summary>
        /// 微信身份认证
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Result PostToken(UserWeixinInut user);
        /// <summary>
        /// 获取微信accessToken
        /// </summary>
        /// <returns></returns>
        Task<Result<string?>> GetWxToken();
        /// <summary>
        /// 获取头像
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        FileContentResult? GetIcon(string user);

        /// <summary>
        /// 获取openid
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Result<string?>> GetOpenidAsync(string code);

        /// <summary>
        /// 根据手机号获取人员信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Result<UserOut>> GetPhoneAsync(string code);

        /// <summary>
        /// 企业微信OAuth2授权
        /// </summary>
        /// <param name="state">状态参数，用于回调时标识请求</param>
        /// <returns>授权URL</returns>
        IResult GetWechatEnterpriseAuthUrl(string state);

        /// <summary>
        /// 企业微信OAuth2回调处理
        /// </summary>
        /// <param name="code">授权码</param>
        /// <param name="state">状态参数</param>
        /// <returns>包含token的回调URL</returns>
        Task<IResult> HandleWechatEnterpriseCallbackAsync(string code, string state);
    }
}

